<!DOCTYPE html PUBLIC "-//W3C//Dtd Xhtml 1.0 transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:include page="${contextPath}/common/jsp_head_new.jsp" />
<% String contextPath = request.getContextPath(); %>
<%@taglib uri="/jstl/cout" prefix="c" %>
<%@taglib uri="/jstl/fmt" prefix="fmt" %>
<title>节能惠民上报</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<BODY>
<div class="navigation">
<img src="../../img/nav.gif" />&nbsp;当前位置： 节能惠民管理&nbsp;&gt;&nbsp;节能惠民信息上报</div>  
  <form name="fm" >
  	<input type=hidden name='vin' id='vin' value='${map.VIN }'/>
  	<input type=hidden name='purChasedDate' id='purChasedDate' value='${map.PURCHASED_DATE }'/>
  	<input type=hidden name='modelName' id='modelName' value='${map.MODELNAME }'/>
  	<input type=hidden name='modelCode' id='modelCode' value='${map.MODELCODE }'/>
  	<input type=hidden name='salePrice' id='salePrice' value='${map.PRICE }'/>
  	<input type=hidden name='dealerName' id='dealerName' value='${map.DEALER_SHORTNAME }'/>
  	<input type=hidden name='ctmName' id='ctmName' value='${map.CTM_NAME }'/>
  	<input type=hidden name='ctmId' id='ctmId' value='${map.CTM_ID }'/>
  	<input type=hidden name='dealerId' id='dealerId' value='${map.DEALER_ID }'/>
  	<input type=hidden name='modelId' id='modelId' value='${map.MODEL_ID }'/>
  	<input type=hidden name='orgId' id='orgId' value='${map.ORG_ID }'/>
  	<input type=hidden name='salesId' id='salesId' value='${map.SALES_ID }'/>
  	<input type=hidden name='vichId' id='vichId' value='${map.VEHICLE_ID }'/>
    <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="91908E"  class="table_edit">
       <tr>
         <th colspan="6"  ><img class="nav" src="../../img/subNav.gif" /> 销售信息</th>
       </tr>
	   <tr>
			<td align="right" nowrap width="15%">VIN：</td>
			<td align="left" nowrap width="30%">${map.VIN }</td>
			<td align="right" nowrap width="15%">销售时间：</td>
			<td align="left" nowrap width="30%">${map.PURCHASED_DATE }
			</td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">车型名称：</td>
			<td align="left" nowrap width="30%">${map.MODELNAME }</td>
			<td align="right" nowrap width="15%">车型代码：</td>
			<td align="left" nowrap width="30%">${map.MODELCODE }</td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">发票号：</td>
			<td align="left" nowrap width="30%">
				<input type="text" onblur="javascript:checkNoFormat();" name="invoceNo" id="invoceNo" class="short_txt" value="${map.INVOICE_NO}" maxlength="6"/> &nbsp;<font color="red">*输入发票号后6位</font>
			</td>
			<td align="right" nowrap width="15%">牌照号：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="vichNo" id="vichNo" class="middle_txt" value="${map.VEHICLE_NO }" /> &nbsp;<font color="red">*</font>
			</td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">厂产指导价：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="factoryPrice" id="factoryPrice" class="short_txt" value="" /> 元&nbsp;<font color="red">*</font>
			</td>
			<td align="right" nowrap width="15%">销售价格：</td>
			<td align="left" nowrap width="30%">${map.PRICE } 元</td>
	   </tr>
    </table>
	<br />
	<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="91908E"  class="table_edit">
       <tr>
         <th colspan="6"  ><img class="nav" src="../../img/subNav.gif" /> 经销商信息</th>
       </tr>
	   <tr>
			<td align="right" nowrap width="15%">经销商名称：</td>
			<td align="left" nowrap width="30%">${map.DEALER_SHORTNAME }</td>
			<td align="right" nowrap width="15%"></td>
			<td align="left" nowrap width="30%"></td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">联系人：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="linkPerson1" id="linkPerson1" class="short_txt" value="${map.LINK_MAN }" /> &nbsp;<font color="red">*</font>
			</td>
			<td align="right" nowrap width="15%">联系电话：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="linkTel1" id="linkTel1" class="middle_txt" value="${map.PHONE }" /> &nbsp;<font color="red">*</font>
			</td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">邮编：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="saleZipCode1" id="saleZipCode1" class="short_txt" maxlength="6" value="${map.ZIP_CODE }" /> &nbsp;<font color="red">*</font>
			</td>
			<td align="right" nowrap width="15%"></td>
			<td align="left" nowrap width="30%">
			</td>
	   </tr>
	   <tr>
	   <td align="right" nowrap width="15%">省：</td>
			<td align="left" nowrap width="30%">
				<select class="min_sel" id="dPro" name="dPro" onchange="_genCity(this,'dCity')"></select> 
				 &nbsp;<font color="red">*</font>
			</td>
		<td align="right" nowrap width="15%">市：</td>
			<td align="left" nowrap width="30%">
				<select class="min_sel" id="dCity" name="dCity" ></select>
				 &nbsp;<font color="red">*</font>
			</td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">详细地址：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="address2" id="address2" class="long_txt" value="${map.DEALER_ADDRESS }" /> &nbsp;<font color="red">*</font>
			</td>
			<td align="right" nowrap width="15%"></td>
			<td align="left" nowrap width="30%"></td>
	   </tr>
    </table>
	<br />
	<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="91908E"  class="table_edit">
       <tr>
         <th colspan="6"  ><img class="nav" src="../../img/subNav.gif" /> 消费者信息</th>
       </tr>
	   <tr>
			<td align="right" nowrap width="15%">消费者名称：</td>
			<td align="left" nowrap width="30%">${map.CTM_NAME }</td>
			<td align="right" nowrap width="15%"></td>
			<td align="left" nowrap width="30%"></td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">联系人：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="linkPerson2" id="linkPerson2" class="short_txt" value="${map.LINK_MAN }" /> &nbsp;<font color="red">*</font>
			</td>
			<td align="right" nowrap width="15%">联系电话：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="linkTel2" id="linkTel2" class="middle_txt" value="${map.MAIN_PHONE }" /> &nbsp;<font color="red">*</font>
			</td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">邮编：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="saleZipCode2" id="saleZipCode2" class="short_txt" maxlength="6" value="${map.POST_CODE }" /> &nbsp;<font color="red">*</font>
			</td>
	   		<td align="right" nowrap width="15%">省：</td>
			<td align="left" nowrap width="30%">
				<select class="min_sel" id="cPro" name="cPro" onchange="_genCity(this,'cCity')"></select> 
				 &nbsp;<font color="red">*</font>
			</td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">市：</td>
			<td align="left" nowrap width="30%">
				<select class="min_sel" id="cCity" name="cCity" onchange="_genCity(this,'cTown')"></select>
				 &nbsp;<font color="red">*</font>
			</td>
			<td align="right" nowrap width="15%">县：</td>
			<td align="left" nowrap width="30%">
				<select class="min_sel" id="cTown" name="cTown"></select> 
				 &nbsp;<font color="red">*</font>
			</td>
	   </tr>
	   <tr>
			<td align="right" nowrap width="15%">详细地址：</td>
			<td align="left" nowrap width="30%">
				<input type="text" name="address2" id="address2" class="long_txt" value="${map.CTM_ADDRESS }" /> &nbsp;<font color="red">*</font>
			</td>
			<td align="right" nowrap width="15%"></td>
			<td align="left" nowrap width="30%"></td>
	   </tr>
    </table>
	<br />
	
     <table class="table_edit">
		<tr> 
			<td align="right" nowrap width="15%">备注：</td>
			<td align="left" nowrap width="30%"><textarea name="remark" id="remark" cols="60" rows="3"></textarea></td>
			<td align="right" nowrap width="15%"></td>
			<td align="left" nowrap width="30%"></td>
		</tr>
		<tr > 
            <td height="12" align="center" colspan="4">
				<input type="button" onclick="doReport();" class="normal_btn"  style="width=8%" value="提报"/>&nbsp;&nbsp;
				<input type="button" onClick="javascript:history.go(-1) ;" class="normal_btn"  style="width=8%" value="返回"/>
			</td>
		</tr>
    </table>
</form>
<script type="text/javascript" > 
genLocSel('dPro','cCity','','${map.PROVINCE_ID}','${map.CITY_ID}',''); // 加载省份城市和县
genLocSel('cPro','cCity','cTown','${map.PROVINCE}','${map.CITY}','${map.TOWN}'); // 加载省份城市和县
_genCity($('dPro'),'dCity');
_genCity($('cPro'),'cCity');
_genCity($('cCity'),'cTown');
	function doReport(){
			
		if($('invoceNo').value==''||$('invoceNo').value==null){
			MyAlert('请输入发票号！');
			return;
		}
		if(!checkNoFormat()){
			return;
		}
		if($('vichNo').value==''||$('vichNo').value==null){
			MyAlert('请输入车牌号！');
			return;
		}
		if($('factoryPrice').value==''||$('factoryPrice').value==null){
			MyAlert('请输入厂产指导价！');
			return;
		}
		if($('linkPerson1').value==''||$('linkPerson1').value==null){
			MyAlert('请输入经销商联系人！');
			return;
		}
		if($('linkTel1').value==''||$('linkTel1').value==null){
			MyAlert('请输入经销商联系电话！');
			return;
		}
		if($('saleZipCode1').value==''||$('saleZipCode1').value==null){
			MyAlert('请输入邮编！');
			return;
		}
		if($('dPro').value==''||$('dPro').value==null){
			MyAlert('请输入经销商所属省份！');
			return;
		}
		if($('dCity').value==''||$('dCity').value==null){
			MyAlert('请输入经销商所属城市！');
			return;
		}
		if($('address2').value==''||$('address2').value==null){
			MyAlert('请输入经销地址！');
			return;
		}
		if($('linkPerson2').value==''||$('linkPerson2').value==null){
			MyAlert('请输入客户联系人！');
			return;
		}
		if($('linkTel2').value==''||$('linkTel2').value==null){
			MyAlert('请输入客户联系电话！');
			return;
		}
		if($('saleZipCode2').value==''||$('saleZipCode2').value==null){
			MyAlert('请输入邮编！');
			return;
		}
		if($('cPro').value==''||$('cPro').value==null){
			MyAlert('请输入客户所属省份！');
			return;
		}
		if($('cCity').value==''||$('cCity').value==null){
			MyAlert('请输入客户所属城市！');
			return;
		}
		if($('cTown').value==''||$('cTown').value==null){
			MyAlert('请输入客户所属县！');
			return;
		}
        if($('address2').value==''||$('address2').value==null){
			MyAlert('请输入客户地址！');
			return;
		}
		
		var url="<%=contextPath %>/conservation/EnergyConservationDlr/vehicleEnergyConReport.json?COMMAND=1";
		makeNomalFormCall(url,showEnergyNo,"fm");
		//window.location.href="<%=contextPath%>/conservation/EnergyConservationDlr/vehicleEnergyConReport.do?vehicleId="+vehicleId;;
	}  
	function showEnergyNo(data){

		MyselfAlertForFun('节能惠民申请编号： '+data.jNo,goBack);
	}
	function goBack(){
		window.location.href="<%=contextPath%>/conservation/EnergyConservationDlr/vehicleEnergyConApply.do";
	}
	
	function MyselfAlertForFun(info,fun){
		 var owner = getTopWinRef();
		 try{
		  _myDialogInit();  
		  owner.getElementById('dialog_content_div').innerHTML='\
		    <div style="font-size:12px;">\
		     <div style="background-color:#08327e; padding:8px 5px 5px 10px; color:#ffffff;">\
		      <b>信息</b>\
		     </div>\
		     <div id="dialog_alert_info" style="padding:10px; line-height:2em"></div>\
		     <div style="padding:2px;text-align:center;background:#D0BFA1;">\
		      <input id="dialog_alert_button" type="button" value="确定" style="padding:2px 0px 0px 0px; background-color:#08327e;color:#FFF;font-size:12px;border-top:1px solid #DDD;border-left:1px solid #DDD;border-right:1px solid #333;border-bottom:1px solid #333;"/>\
		     </div>\
		    </div>';
		  owner.getElementById('dialog_alert_info').innerHTML=info;
		  owner.getElementById('dialog_alert_button').onclick=function(){
			try{
			 if(fun){
			  fun();
			 }
			}finally{
			 _hide();
			}
		  };
		  _setSize(300, 200); 
		  _show();
		 }catch(e){
		  alert('MyAlert : '+ e.name+'='+e.message);
		 }finally{
		  owner=null;
		 }
		}
	function _myDialogInit(sWidth ,sHeight ,sTop ,sLeft){//初始化
	    var owner = null;
		owner = getTopWinRef();
		if( owner.getElementById('dialog_div')==null ){
			var div = owner.createElement('div');
			div.setAttribute('id','dialog_div');
			owner.getElementsByTagName('body').item(0).appendChild(div);
			
			_crtBackGlassDiv(sWidth ,sHeight ,sTop ,sLeft);
			_crtBackIFrame(sWidth ,sHeight ,sTop ,sLeft); //add by zhaoli
			_crtModalDiv(sWidth ,sHeight ,sTop ,sLeft);
			_crtBackGroudDiv();
			_crtContentDiv();
			_crtContentFrame();
		} 
		if(owner.getElementById('dialog_modal_div')!=null){
			owner.getElementById('dialog_modal_div').onclick = function(){}
		}
		owner =null;
	}
	//验证发票位数据
	function checkNoFormat(){
		var val = $('invoceNo').value;	
		if(val.length<6){
			//$('invoceNo').value="";
			MyAlert('发票格式不对');
			return false;
		}else{
			return true;
		}
	}
</SCRIPT>
</BODY>
</html>